package internal.test;

import internal.MyEventBus;
import internal.MySubscribe;

/**
 *
 * Created by DJJ on 2019/3/28.
 */
public class MyEventBusExample {
    public static void main(String[] args) {
        MyEventBus myEventBus=new MyEventBus((cause, context) ->
        {
            cause.printStackTrace();
            System.out.println("==========================================");
            System.out.println(context.getSource());
            System.out.println(context.getSubscribe());
            System.out.println(context.getEvent());
            System.out.println(context.getSubscriber());
        });
        myEventBus.register(new MySimpleListener());
        myEventBus.register(new MySimpleListener2());
        myEventBus.register(new MyEventBusExample());
        myEventBus.post(123131);
        myEventBus.post("7676");
        myEventBus.close();
    }
    @MySubscribe
    public void my(String xx){
        System.out.println("MyEventBusExample---"+xx);

    }
}
